package vn.demand.dragon.model.business
{
	import mx.controls.Alert;
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.http.HTTPService;
	
	public class UserLoginDelegate
	{
		private var service : HTTPService;
		private var responder : IResponder;
		
		public function UserLoginDelegate(responder:IResponder)
		{
			service = new HTTPService();
			service.url = "http://dev.dragon.com/index.php?suppressHeaders=1";
			service.method = 'POST';
			service.resultFormat = 'e4x';
			this.responder = responder;
		}
		
		public function login(userName:String, password:String):void {
			var token : AsyncToken = service.send({username: userName, password: password, login: 'sql'});
			token.addResponder( responder );
			token.action = 'login';
		}

	}
}